﻿using System;
using System.Runtime.Serialization;

// Namespace does not match code / folder hierarchy as I wanted it to reflect the facebook structure
namespace Facebook.auth
{
    /// <summary>
    /// Type that can be serialised from JSON to a .net class
    /// http://wiki.developers.facebook.com/index.php/Auth.getSession
    /// </summary>
    [DataContract]
    public class getSession
    {
        [DataMember]
        public string session_key { get; set; }

        [DataMember]
        public string secret { get; set; }

        [DataMember]
        public long uid { get; set; }

        [DataMember]
        public double expires { get; set; }

        // Property to return the expiry date in a .net friendly datetime instead of the unix time
        [IgnoreDataMember]
        public DateTime expires_DateTime { get { return Facebook.Helpers.ConvertUnixTimestampToDotNet(expires); }  }
    }
}
